package action;

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import dao.BaseHibernateDao;
import dao.ReportDAO;
import dao.impl.ReportDAOImpl;

import bean.Meeting;
import bean.Report;


public class ReportsearchAction extends HttpServlet {
	private ReportDAO rd=new ReportDAOImpl();
public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
			
	}

	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		String page="";
		request.setCharacterEncoding("gbk");
		String completeState = request.getParameter("completeState");
		String completeTime = request.getParameter("completeTime");
		int depId=Integer.parseInt(request.getParameter("depId"));
		int eid=Integer.parseInt(request.getParameter("eid"));
		int pid=Integer.parseInt(request.getParameter("pid"));
		Report condition=new Report();
		if(null!=completeTime || "".equals(completeTime))
		{
			condition.setCompletetime(completeTime);
		}
		if(null!=completeState || "".equals(completeState)){
			condition.setCompletestate(completeState);
		}
		request.setAttribute("list", ((BaseHibernateDao) rd).search(condition, Report.class));
		RequestDispatcher rd=request.getRequestDispatcher(page);
		rd.forward(request, response);
		
	}
}
